package 预科0102Phone;

public class PhoneTest {
	public static void main(String[] args) {
		//确定电话卡类型-大卡
		EnumPhoneCardType phoneCardType=EnumPhoneCardType.BIG;
		//新建电话卡 PhoneCard(String cardType, int cardNum, String name, String password, int remainder, float callTime,float netFlow)
		PhoneCard card=new PhoneCard(phoneCardType.getCardType(), 110, "police", "abc", 1000, 0,0);
		card.show();
		//新建通话套餐 CallPlan(float callTime, int textNum,int cost)
		PhonePlan callplan=new CallPlan(100,100,100);
		callplan.show();
		//新建上网套餐 DataPlan(float netFlow,int cost) 
		PhonePlan dataplan=new DataPlan(100,100);
		dataplan.show();
		//实现通话服务 callService(float callTime,PhoneCard card )
		((CallPlan) callplan).callService(100,card);
		card.show();
		callplan.show();
		//实现上网服务 dataService(float netFlow,PhoneCard card )
		((DataPlan) dataplan).dataService(100,card);
		card.show();
		dataplan.show();

		//新建用户消费 UserConsumption(float sumCallTime, float sumNetFlow, float sumCost) 
		UserConsumption con =new UserConsumption(card.getCallTime(),card.getNetFlow(),callplan.getCost()+dataplan.getCost());
		con.show();
	}

}
